package com.sand.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "information", schema = "ssh_pro", catalog = "")
public class InformationEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private String title;
    private long readNumber;
    private Timestamp createTime;
    private String content;
    private String preface;

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "readNumber")
    public long getReadNumber() {
        return readNumber;
    }

    public void setReadNumber(long readNumber) {
        this.readNumber = readNumber;
    }

    @Basic
    @Column(name = "createTime")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        InformationEntity that = (InformationEntity) o;
        return rid == that.rid && readNumber == that.readNumber && Objects.equals(title, that.title) && Objects.equals(createTime, that.createTime) && Objects.equals(content, that.content);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, title, readNumber, createTime, content);
    }

    @Basic
    @Column(name = "preface")
    public String getPreface() {
        return preface;
    }

    public void setPreface(String preface) {
        this.preface = preface;
    }
}
